/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CampoDeTexto;

import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;

/**
 *
 * @author rodrig0
 */
public class apenasMaiusculas  extends PlainDocument{
    @Override
    public void insertString(int offset, String str, javax.swing.text.AttributeSet attr) throws BadLocationException{
        super.insertString(offset, str.toUpperCase().replaceAll("[^A-Z| ^Á-Ú| ^À]", ""), attr);
    }
    
    public void replace(int offset, String str, javax.swing.text.AttributeSet attr) throws BadLocationException{
        super.insertString(offset, str.toUpperCase().replaceAll("[^A-Z| ^Á-Ú| ^À]", ""), attr);
    }
}
